//
//  DetailedViewController.h
//  iHealthEHR
//
//  Created by Joseph Ayo Akinyele on 3/14/10.
//  Copyright 2010 Johns Hopkins University. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ProfileCell.h"
#import "EncryptedCell.h"
#import "CCRObject.h"
#import "XMLParser.h"
#import "GoogleHealth.h"
#import "MedsViewController.h"
#import "CPABEInterface.h"
@class MedsViewController;

@interface UIActionSheet (extended)
-(void) setNumberOfRows:(NSUInteger) rows;
@end

@interface DetailedViewController : UITableViewController 
	<UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate>
{
	/* stores array of entries for a particular ccr subsection */
	NSMutableArray *ccrObjects;
	/* sub-section the above ccrObject belongs to */
	NSString *ccrSubSection;
	MedsViewController *mvc;
	BOOL LoggedInThruGoogleHealth; // if yes, display google health options, if not, display other.
	BOOL UserSelectedDecryption;
	GoogleHealth *googlehealth;
	CPABEInterface *ptrToCPabe;
	
	UIImage *lockIcon, *ccrIcon;
	
	// for options
	id selTarget;
	SEL selFunction;
	
	UIProgressView *progbar;
	UIActionSheet *basesheet;
	CGFloat amountDone;	
}

@property (nonatomic, retain) NSArray *ccrObjects;
@property (nonatomic, retain) NSString *ccrSubSection;
/* help determine whether Google Health or custom Hospital login */
@property (nonatomic) BOOL LoggedInThruGoogleHealth, UserSelectedDecryption;
@property (nonatomic, retain) GoogleHealth *googlehealth;
@property (nonatomic, retain) CPABEInterface *ptrToCPabe;
/* GoogleHealh CCR and Hopsital CCR views dictate what options they support. 
 Must specify both when instantiating view controller*/
@property (nonatomic, retain) id selTarget;
@property (nonatomic) SEL selFunction;
@property (nonatomic, retain) UIActionSheet *basesheet;
@property (nonatomic, retain) UIProgressView *progbar;

-(void) decryptSpecifiedEntry:(NSUInteger) index;
-(void) viewABEpolicy:(NSUInteger) index;
+(NSString *) parseDescription:(CCRObject *) object ofCCR:(NSString *) section;
-(void) incrementBar:(id) timer;
-(void) showStatus:(NSString *) message; 
-(void) showTheProgress:(NSString *) message;
-(void) showTheProgress:(NSString *) message target:(id) theTarget withInc:(SEL) incrementFunction;

@end
